import request from '@/utils/request'
import { buildQueryParams } from '@/utils/common'

// 查询企业员工列表
export function getAllStaff(data) {
    const queryString = buildQueryParams(data)
    return request({
        url: '/store/store/staff/list?'+queryString,
        method: 'GET'
    })
}

// 添加、修改员工
export function updateStaff(data) {
    return request({
        url: '/store/store/staff',
        method: 'POST',
        data
    })
}

// 删除员工
export function removeStaff(data) {
    return request({
        url: '/store/store/staff/'+data,
        method: 'DELETE'
    })
}

// 员工详细信息
export function getStaffInfo(data) {
    return request({
        url: '/store/store/staff/'+data,
        method: 'GET'
    })
}

// 查看审核店铺员工列表
export function getAuditStaffList({ pageSize, pageNum, storeId, auditState }) {
    return request({
        url: `/store/audit/staff/list?pageSize=${pageSize}&pageNum=${pageNum}&storeId=${storeId}&auditState=${auditState}`,
        method: 'GET'
    })
}

// 邀请员工
export function inviteStaff(data) {
    return request({
        url: '/store/audit/staff/form',
        method: 'POST',
        data
    })
}

// 审核员工
export function processStaff(data) {
    return request({
        url: '/store/audit/staff',
        method: 'POST',
        data
    })
}

// 查看审核店铺员工详情
export function getAuditStaffInfo(data) {
    return request({
        url: '/store/audit/staff/info?auditStaffId='+data,
        method: 'GET'
    })
}

// 员工排名列表
export function getStaffRankingList(data) {
    return request({
        url: '/store/store/staff/switch/modes',
        method: 'POST',
        data
    })
}

// 奖惩记录列表
export function rewardsAndPenalties(data) {
    return request({
        url: '/store/reward/punishment/list',
        method: 'POST',
        data
    })
}